var { getLoginedUser, fnLoading, fnHideLoading, fnSuccess, fnFail } = require('../../utils/index')
import { domainStatic } from '../../utils/env.js';
import _ from '../../utils/underscore.js';
import { get, fnChoose, lsGetStr, lsGetObj, lsSetStr, fnUpload, post } from '../../utils/request.js';
// pages/popularize/index.js
var app = getApp
Page({

  
  onLoad(options){
    // debugger;
    this.setData({
      options: options,
    })
    // wx.showShareMenu({
    //   withShareTicket: true
    // })
  },
  onShareAppMessage: function () {
    let that = this;
    let queryStr = 'shareId=' + lsGetObj('loginedUser').id +
      '&no=' + (Math.random() + '').split('.')[1] +
      '&type1=' + that.options.type1;
    console.log(queryStr);
    return {
      title: '闻权免费申请版权，企业logo，艺术作品，文字作品，软件APP，小程序等都可以申请版权，快来找闻权登记版权吧', // 转发后 所显示的title
      path: '/pages/home2/index?partnerId=' + lsGetObj('loginedUser').id
,// 相对的路径
      imageUrl: 'http://www.taicanglimi.cn/admin/imgs/min/share.png',
      success: (res) => {    // 成功后要做的事情
        wx.getShareInfo({
          shareTicket: res.shareTickets[0],
          success: (res) => {
            
            that.setData({
              isShow: true
            })
          },
          fail: function (res) { 1111,console.log(res) },
          complete: function (res) { console.log(res) }
        })
      },
      fail: function (res) {
        // debugger;
        // 分享失败
        
        console.log(res)
      }
    }
  }
})